package com.bitters.fileupload.config;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author thomashe
 * @date 2022/5/30
 **/
@Configuration
@EnableAutoConfiguration
public class MyWebMvcConfigurer implements WebMvcConfigurer {


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/api/**").addResourceLocations("file:F:/");
    }

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.OAS_30).apiInfo(new ApiInfoBuilder().contact(new Contact("thomas.he", "", "")).title("Swagger3 demo").build());
    }
}
